package com.example.tests;

import org.testng.annotations.Test;

import com.example.utils.SortedListOf;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

public class GroupCreationTests extends TestBase {
	
		@Test(dataProvider = "groupsFromFile")
        public void testGroupCreationWithValidData(GroupData group) throws Exception {
				SortedListOf<GroupData> oldList = app.getGroupHelper().getGroups();
                app.getGroupHelper().createGroup(group);
                SortedListOf<GroupData> newList = app.getGroupHelper().getGroups();
                assertThat(newList,equalTo(oldList.withAdded(group)));
        }

}
